package what.the.fun.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import what.the.fun.domain.Survey;

public class SurveyExtractor implements ResultSetExtractor<Survey>{

	@Override
	public Survey extractData(ResultSet arg0) throws SQLException,
			DataAccessException {
		Survey data = new Survey();
		data.setSurveyId(arg0.getString(1));
		data.setName(arg0.getString(2));
		data.setCampId(arg0.getString(3));
		
		return data;
	}

}
